const {
  mrjAsyncBaseReq, //  基本请求
  BaseRequestModel, // 基本请求对象
} = require('./mrhhttp')


const api_load_list = "/face/shop/guest/list"
const api_load_day_list = "/face/shop/guest/day/list"
const api_load_detail = "/core//merchant/shop/cashier/detail"
const api_action_add = "/core/merchant/shop/cashier/add"
const api_action_delete = "/core/merchant/shop/cashier/delete"
const api_action_edit = "/core/merchant/shop/cashier/edit"
const api_load_history_list = "/face/shop/guest/visit/list"
const api_load_dashboard = "/face/shop/guest/dashboard"
const api_load_day_dashboard = "/face/shop/guest/day/dashboard"
const api_load_hour_list = "/face/shop/guest/analysis/hour/list"

const VisitorHttp = {
  
  loadDashbord:async param =>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_load_dashboard}`,
      param: param
    });
    return res.data
  },
  loadDayDashbord:async param =>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_load_day_dashboard}`,
      param: param
    });
    return res.data
  },
 

  
  actionDelete:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_action_delete}`,
      param: param
    });
    return res.data
  },
  actionAdd:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_action_add}`,
      param: param
    });
    return res.data
  },
  actionEdit:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_action_edit}`,
      param: param
    });
    return res.data
  },
  loadList:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_load_list}`,
      param: param
    });
    return res.data
  },
  loadDayList:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_load_day_list}`,
      param: param
    });
    return res.data
  },
  loadHourAnalysisList:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_load_hour_list}`,
      param: param
    });
    return res.data
  },
  
  
  loadHistoryList:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_load_history_list}`,
      param: param
    });
    return res.data
  },
  
  loadDetail:async param=>{
    const res = await mrjAsyncBaseReq({
      ...BaseRequestModel,
      url: `${BaseRequestModel.baseUrl}${api_load_detail}`,
      param: param
    });
    return res.data
  },
}
module.exports = VisitorHttp